import './App.css';
import React, { Component } from 'react';
import $ from 'jquery';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import Layout from '@/components/Layout';

class App extends Component {
	componentDidMount() {
		this.getRemSize();
		$(window).resize(() => {
			this.getRemSize();
		});
	}

	// 更改html基准font-size
	getRemSize() {
		var wDefault = 16 / 1920;
		var width = window.innerWidth;
		var rem = width * wDefault;
		console.log(width);
		if (width > 1000) {
			$('html').css('font-size', rem + 'px');
		}
	}
	render() {
		return (
			<Router>
				<Switch>
					<Route path="/" component={Layout}></Route>
				</Switch>
			</Router>
		);
	}
}
export default App;
